<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
</h:head>
<h:body>

	<h:form>
  
  		
		<h:panelGrid columns="3">
		
			<h:outputLabel for="name" value="Name: " />
			<p:inputText id="name" value="#{createActivityBean.name}"
				required="true" label="Name">
				<f:validateLength minimum="3" />
			</p:inputText>
			<p:message for="name" />  

			<h:outputLabel for="description" value="Description: " />
			<p:inputTextarea id="description" value="#{createActivityBean.description}"
				required="true" rows="4" cols="50">
				<f:validateLength minimum="3" />
			</p:inputTextarea>
			<p:message for="description" />

			<h:outputText value="Category: " />
			<p:selectOneMenu value="#{createActivityBean.selectedCategory}" id="selectedCategory" effect="fade" converter="categoryConverter">
				<f:selectItem itemLabel="Select Category" itemValue="" />
				<f:selectItems value="#{categoryListBean.categories}" var="category" itemLabel="#{category.name}" itemValue="#{category}" />
			</p:selectOneMenu>
			<p:message for="selectedCategory" />
      

			<h:outputLabel for="popupButtonStartDateCal" value="Start Date: " />		
			<p:calendar value="#{createActivityBean.startDate}" id="popupButtonStartDateCal" showOn="button" />
			<p:message for="popupButtonStartDateCal" />  
			
			<h:outputLabel for="popupButtonEndDateCal" value="End Date: " />		
			<p:calendar value="#{createActivityBean.endDate}" id="popupButtonEndDateCal" showOn="button" />
			<p:message for="popupButtonEndDateCal" /> 
			
			<h:outputLabel for="" value="" />
			<p:commandButton value="Save" actionListener="#{createActivityBean.saveActivity}" ajax="false">
			</p:commandButton>
			<h:outputLabel for="" value="" />
			
	  </h:panelGrid>
			
	</h:form>

</h:body>
</html>